package com.hiwhitley.easy.day06;

/**
 * Created by hiwhitley on 2016/8/6.
 */
public class JumpFloorIIDemo {
    public static int JumpFloorII(int target) {
        if (target <= 0) {
            return -1;
        } else if (target == 1) {
            return 1;
        } else {
            return 2 * JumpFloorII(target - 1);
        }
    }

    public int RectCover(int target) {
        if (target <= 1) {
            return 1;
        }
        if (target * 2 == 2) {
            return 1;
        } else if (target * 2 == 4) {
            return 2;
        } else {
            return RectCover((target - 1)) + RectCover(target - 2);
        }
    }

    public static void main(String[] args) {
        System.out.println(JumpFloorII(6));
    }
}
